;;;
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;     http://paracadd.com
;;;	All rights reserved.
;;;
;;;	Copyright:  5-21-2004
;;;	   Edited:  2-13-2007
(defun ppgrida_error (msg / )
  (if old_attrreq
    (setvar "attreq" old_attreq)
  )
  (princ msg)
  (setq *error* old_ppgrida_error)
  (princ)
)
(defun c:ppgrida ()
  (setq old_ppgrida_error *ERROR*)
  (setq *error* ppgrida_error)
  (if uint nil (load "uint" "File UINT.LSP not found! "))
  (SETQ old_attreq (GETVAR "ATTREQ"))
  (SETVAR "ATTREQ" 0)
  (setvar "ltscale" 0.5)
  (if (eq (getvar "tilemode") 1)
    (setvar "tilemode" 0)
  )
  (setq gridsclint (uint 1 "50 100" "Grid Scale [50/100]" (if gridsclint gridsclint 100)))
  (if (or (eq gridsclint 50)(eq gridsclint 100))
    (setq gridscl (itoa gridsclint))
    (setq gridscl nil)
  )
  (IF (AND gridscl (OR (wcmatch gridscl "50")(wcmatch gridscl "100")))
    (progn
  (if c:mklayr nil (load "mklayr" "\nFile MKLAYR.LSP not loaded! "))
  (c:svlayr)
  (command ".pspace")
  (command "-layer" "m" (STRCAT gridscl "ppgrida") "")
  (command "-insert" (STRCAT gridscl "ppgrida") "0,0" 1 1 0)
  (c:rslayr)
    )
  )
  (SETVAR "ATTREQ" old_attreq)
  (setq *error* old_ppgrida_error)
  (princ)
)